package com.xuhuan.admin.controller.user;

import com.xuhuan.admin.entity.User;
import com.xuhuan.admin.response.Result;
import com.xuhuan.admin.service.user.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: huan.xu
 * @create: 2024/6/10 11:30
 * @description:
 **/
@Controller
@RequestMapping("/user")
public class UserController {

  @Autowired
  private UserService userService;


  /**
   * 获取用户信息
   *
   * @return
   */
  @GetMapping("/userInfo")
  @ResponseBody
  public Result<User> userInfo() {
    User user = userService.getUserByUserName("xuhuan");
    return Result.success(user);
  }

}
